Don't mutate strings in cl-substitute
authorMattias Engdegård <mattiase@acm.org>
Wed, 8 May 2024 10:13:48 +0000 (12:13 +0200)
committerMattias Engdegård <mattiase@acm.org>
Wed, 8 May 2024 14:38:40 +0000 (16:38 +0200)
commitde5a89254cb8645143e9f4e51a1727a7237109e8
tree7d34e8eb4e704245f54de7c42e8859c80c215562
parentb82a003544c607b5c54bab13870d52b53e70aeb8
Don't mutate strings in cl-substitute

This fixes cl-substitute, cl-substitute-if, cl-substitute-if-not,
cl-nsubstitute, cl-nsubstitute-if and cl-nsubstitute-if-not,
when called with a string sequence argument.

* lisp/emacs-lisp/cl-seq.el (cl-nsubstitute):
Avoid running in O(n^2) time and make future-safe.
lisp/emacs-lisp/cl-seq.el